Passed
Pull Request — master (#223)
by Daniel
01:35
created

MainClass.addEventHandlers   A

Complexity

Conditions 2

Size

Total Lines 15
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 15
rs 9.85
c 0
b 0
f 0
cc 2
1
import "animate.css";
2
3
import checkValidText from "./classes/ValidText/classValidText";
4
import sendForm from "./classes/ProcessInputForm/classProcessInputForm";
5
6
const initialize = (): void => {
7
  const textInput = window.document.getElementById(
8
    "bilinformasjon"
9
  ) as HTMLInputElement;
10
  const textForm = window.document.getElementById("regnrform");
11
12
  if (textInput && textForm) {
13
14
    console.log("Adding event listeners ...");
15
16
17
    textInput.addEventListener("input", () => checkValidText);
18
    textForm.addEventListener("submit", () => sendForm);
19
  }
20
};
21
22
initialize();
23